﻿#include "common.h"

Game game{ false, 29, 0 };

bool getQuit() {
	return game.quit;
}

void doQuit() {
	game.quit = true;
}
// 获取游戏天数，比如：第01年春01日 周一
string getGameDayText() {
	int day = game.day;

	int season = (day / 28 + 1) % 4;

	int year = day / 28 / 4 + 1;

	int date = day % 28;

	int weekDay = date % 7;

	string result;

	string yearText = padStart(to_string(year), 2, '0');

	string seasonText = array<string, 5>({ "", "春", "夏", "秋", "冬" })[season];

	string dateText = padStart(to_string(date), 2, '0');

	array<string, 7>weekDays{ "日", "一", "二", "三", "四", "五", "六" };

	result = "第" + yearText + "年" + seasonText + dateText + "日" + " 星期" + weekDays[weekDay];

	return result;
}

// 展示游戏内时钟
//string getClockText() {}